<?php

class FuneralHome extends Zend_Db_Table_Row_Abstract
{
    protected $_name = 'funeral_homes';

    public function get_funeral_dirs()
    {
        $fdirs = new FuneralDirectors();
        $results = $fdirs->findAll("fh_id={$this->id}");
        if(null == $results)
            return array();
        else
            return $results->toArray();
    }

    public function get_submitted_cases()
    {
        $cases = new FDMSCases();
        return $cases->getSubmittedCasesForFH($this->id);
    }

    public function get_open_cases()
    {
        $cases = new FDMSCases();
        return $cases->getOpenCasesForFH($this->id);
    }

    public function get_finished_cases()
    {
        $cases = new FDMSCases();
        return $cases->getFinishedCasesForFH($this->id);
    }
}

?>
